<?
if (empty($ID))
{
	$formaction="/lvs/datacenter_do_add";
	$formbutton="增加";
	$ID="";
}
else
{
	$formaction="/lvs/datacenter_do_edit";
	$formbutton="修改";
}
if (empty($wip))
	$wip="";
if (empty($lip))
	$lip="";
if (empty($servername))
	$servername="";
if (empty($datacenter))
	$datacenter="";
if (empty($gid))
	$gid="";
if (empty($state))
	$state="MASTER";
if (empty($notification_email))
	$notification_email="liuts@hainan.net";
if (empty($notification_email_from))
	$notification_email_from="network@hainan.net";
if (empty($smtp_server))
	$smtp_server="127.0.0.1";
if (empty($smtp_connect_timeout))
	$smtp_connect_timeout="30";
if (empty($router_id))
	$router_id="LVS_DEVEL";
if (empty($interface))
	$interface="eth0";
if (empty($lvs_sync_daemon_inteface))
	$lvs_sync_daemon_inteface="eth0";
if (empty($virtual_router_id))
	$virtual_router_id="51";
if (empty($priority))
	$priority="100";
if (empty($advert_int))
	$advert_int="1";
if (empty($auth_type))
	$auth_type="PASS";
if (empty($auth_pass))
	$auth_pass="1111";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$charset?>" />
<title><?=$title?></title>
<meta  name="keywords" content="<?=$keywords?> " />
<meta  name="description" content="<?=$description?>"/>	

<!-- CSS -->
<link href="/style/css/transdmin.css" rel="stylesheet" type="text/css" media="screen" />
<!--[if IE 6]><link rel="stylesheet" type="text/css" media="screen" href="/style/css/ie6.css" /><![endif]-->
<!--[if IE 7]><link rel="stylesheet" type="text/css" media="screen" href="/style/css/ie7.css" /><![endif]-->

<!-- JavaScripts-->
<script type="text/javascript" src="/style/js/jquery.js"></script>
<script type="text/javascript" src="/style/js/jNice.js"></script>
<script language="javascript" src="/js/prototype.js"></script>
<script language="javascript" src="/js/javafunc.js"></script>
</head>

<body>
<div id="systemWorking" style="z-index:100; position:absolute;display:none;left:40%;top:40%"><table width="250" height="20" border="0" cellpadding="0" cellspacing="1" bgcolor="#6EB1F4"><tr><td bgcolor="#FFFFFF" align="center" valign="middle"><img src="/images/loading.gif" align=center>　　系统正在处理中...</td></tr></table></div>
	<div id="wrapper">
    	<h1><a href="#"><span>天翌LVS管理系统</span></a></h1>     
			<?
			  	include "lvsmenu_view.php";
			?>   
                <!-- // #sidebar -->
                
                <!-- h2 stays for breadcrumbs -->
               
                
                <!-- // #main -->
                <div class="clear"></div>
</div>
            <!-- // #container -->
        </div>	
        <!-- // #containerHolder -->
    </div>
    <!-- // #wrapper -->
<table height="500" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#EEEEEE" class="tables_main">
      <tr>
        <td height="193" align="center">
	<table width="20" border="0" cellpadding="0">
          <tr>
            <td height="4"></td>
          </tr>
        </table>
	<table height="490" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
          <tr>
            <td width="80" height="60" valign="top">
			<?
			include "lvsfunmenu_view.php";
			?>
			</td>
            <td width="1" rowspan="2" align="center" valign="top" bgcolor="#eeeeee"></td>
            <td width="735" rowspan="2" align="center" valign="top">
		<div align="left">
		<table width="98%" height="31" border="0" cellpadding="00" cellspacing="1">
                 <tr>
                   <td width="2">&nbsp;</td>
                 <td width="240" valign="bottom"><a href="/lvs/">LVS管理</a> &raquo; <a href="/lvs/DataCenters" class="active">数据中心</a> &raquo; <a href="#" class="active"><?=$formbutton?></a></td>
                 </tr>
                 <tr>
                   <td></td>
                   <td height="1" bgcolor="#EEEEEE"></td>
                 </tr>
               </table>
		<br />
		<div style="position:relative; height:440px; overflow-y:auto">
<table width="90%" height="400" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td valign="top">
	<form action="<?=$formaction?>" id="postform" name="postform" method="post">
        <table width="90%"  border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#D5DEDB">
          <tr bgcolor="#D5DEDB" height="34">
		<td height="25" colspan="2"><strong><?=$formbutton?>数据中心节点</strong></td>
          </tr>
          <tr bgcolor="#F9F9F9" height="34" >
            <td height="20" align="right">角色：</td>
            <td><input name="state" type="radio" value="MASTER" <?php echo ($state=="MASTER")?"checked":""?>>MASTER
                <input type="radio" name="state" value="BACKUP" onclick="javascript:alert('BACKUP角色填写组ID、服务IP、通讯IP、主机名即可，其它数据保持默认就可以了！');"<?php echo ($state=="BACKUP")?"checked":""?>>BACKUP
	    </td>
          </tr>
          <tr bgcolor="#F9F9F9" height="34" >
            <td height="20" align="right">数据中心名称：</td>
            <td width="453">
                <input name="datacenter" type="text" id="datacenter" value="<?php echo empty($this->validation->datacenter)?$datacenter:$this->validation->datacenter;?>"><?php echo empty($this->validation->datacenter_error)?'':$this->validation->datacenter_error; ?> *如"中国电信"。</td>
          </tr>
          <tr bgcolor="#F9F9F9" height="34" >
            <td height="20" align="right">组ID：</td>
            <td width="453"><input name="gid" type="text" id="gid" value="<?php echo empty($this->validation->gid)?$gid:$this->validation->gid;?>"><?php echo empty($this->validation->gid_error)?'':$this->validation->gid_error; ?> *同一组数据中心要保持一致。</td>
          </tr>
          <tr bgcolor="#F9F9F9" height="34" >
            <td height="20" align="right">服务IP：</td>
            <td width="453"><input name="wip" type="text" id="wip" value="<?php echo empty($this->validation->wip)?$wip:$this->validation->wip;?>"><?php echo empty($this->validation->wip_error)?'':$this->validation->wip_error; ?> *即服务的网卡IP地址。</td>
          </tr>
          <tr bgcolor="#F9F9F9" height="34" >
            <td height="20" align="right">通讯IP：</td>
            <td><input name="lip" type="text" id="lip" value="<?php echo empty($this->validation->lip)?$lip:$this->validation->lip;?>">
            <?php echo empty($this->validation->lip_error)?'':$this->validation->lip_error; ?> *内部通讯网卡IP地址，如是单网卡，则填服务网卡IP。</td>
          </tr>
          <tr bgcolor="#F9F9F9" height="34" >
            <td height="20" align="right">主机名称：</td>
            <td><input name="servername" type="text" id="servername" value="<?php echo empty($this->validation->servername)?$servername:$this->validation->servername;?>">
            <?php echo empty($this->validation->servername_error)?'':$this->validation->servername_error; ?> *内部通讯以计算机名来作为识别。</td>
          </tr>
          <tr bgcolor="#F9F9F9" height="34" >
            <td height="20" align="right">通知邮件：</td>
            <td width="453"><input name="notification_email" type="text" id="notification_email" value="<?php echo empty($this->validation->notification_email)?$notification_email:$this->validation->notification_email;?>"><?php echo empty($this->validation->notification_email_error)?'':$this->validation->notification_email_error; ?></td>
          </tr>

          <tr bgcolor="#F9F9F9" height="34" >
            <td height="20" align="right">邮件发送人：</td>
            <td><input name="notification_email_from" type="text" id="notification_email_from" value="<?php echo empty($this->validation->notification_email_from)?$notification_email_from:$this->validation->notification_email_from;?>">
            <?php echo empty($this->validation->notification_email_from_error)?'':$this->validation->notification_email_from_error; ?></td>
          </tr>
          <tr bgcolor="#F9F9F9" height="34" >
            <td height="20" align="right">SMTP服务器：</td>
            <td><input name="smtp_server" type="text" id="smtp_server" value="<?php echo empty($this->validation->smtp_server)?$smtp_server:$this->validation->smtp_server;?>">
            <?php echo empty($this->validation->smtp_server_error)?'':$this->validation->smtp_server_error; ?></td>
          </tr>
          <tr bgcolor="#F9F9F9" height="34" >
            <td height="20" align="right">SMTP超时(s)：</td>
            <td><input name="smtp_connect_timeout" type="text" id="smtp_connect_timeout" size="5" value="<?php echo empty($this->validation->smtp_connect_timeout)?$smtp_connect_timeout:$this->validation->smtp_connect_timeout;?>">
            <?php echo empty($this->validation->smtp_connect_timeout_error)?'':$this->validation->smtp_connect_timeout_error; ?></td>
          </tr>
          <tr bgcolor="#F9F9F9" height="34" >
            <td height="20" align="right">路由ID：</td>
            <td><input name="router_id" type="text" id="router_id" value="<?php echo empty($this->validation->router_id)?$router_id:$this->validation->router_id;?>">
            <?php echo empty($this->validation->router_id_error)?'':$this->validation->router_id_error; ?></td>
          </tr>
          <tr bgcolor="#F9F9F9" height="34" >
            <td height="20" align="right">服务设备接口：</td>
            <td><input name="interface" type="text" id="interface" size="5" value="<?php echo empty($this->validation->interface)?$interface:$this->validation->interface;?>">
            <?php echo empty($this->validation->interface_error)?'':$this->validation->interface_error; ?></td>
          </tr>
          <tr bgcolor="#F9F9F9" height="34" >
            <td height="20" align="right">探测设备接口：</td>
            <td><input name="lvs_sync_daemon_inteface" type="text" id="lvs_sync_daemon_inteface" size="5" value="<?php echo empty($this->validation->lvs_sync_daemon_inteface)?$lvs_sync_daemon_inteface:$this->validation->lvs_sync_daemon_inteface;?>">
            <?php echo empty($this->validation->lvs_sync_daemon_inteface_error)?'':$this->validation->lvs_sync_daemon_inteface_error; ?></td>
          </tr>	  
          <tr bgcolor="#F9F9F9" height="34" >
            <td height="20" align="right">虚拟路由ID：</td>
            <td><input name="virtual_router_id" type="text" id="virtual_router_id" size="5" value="<?php echo empty($this->validation->virtual_router_id)?$virtual_router_id:$this->validation->virtual_router_id;?>">
            <?php echo empty($this->validation->virtual_router_id_error)?'':$this->validation->virtual_router_id_error; ?></td>
          </tr>
          <tr bgcolor="#F9F9F9" height="34" >
            <td height="20" align="right">优先权：</td>
            <td><input name="priority" type="text" id="priority" size="5" value="<?php echo empty($this->validation->priority)?$priority:$this->validation->priority;?>">
            <?php echo empty($this->validation->priority_error)?'':$this->validation->priority_error; ?></td>
          </tr>
          <tr bgcolor="#F9F9F9" height="34" >
            <td height="20" align="right">同步通知间隔(s)：</td>
            <td><input name="advert_int" type="text" id="advert_int" size="5" value="<?php echo empty($this->validation->advert_int)?$advert_int:$this->validation->advert_int;?>">
            <?php echo empty($this->validation->advert_int_error)?'':$this->validation->advert_int_error; ?></td>
          </tr>
          <tr bgcolor="#F9F9F9" height="34" >
            <td height="20" align="right">验证类型：</td>
            <td><input name="auth_type" type="text" id="auth_type" size="5" value="<?php echo empty($this->validation->auth_type)?$auth_type:$this->validation->auth_type;?>">
            <?php echo empty($this->validation->auth_type_error)?'':$this->validation->auth_type_error; ?></td>
          </tr>
          <tr bgcolor="#F9F9F9" height="34" >
            <td height="20" align="right">验证密码：</td>
            <td><input name="auth_pass" type="text" id="auth_pass" size="10" value="<?php echo empty($this->validation->auth_pass)?$auth_pass:$this->validation->auth_pass;?>">
            <?php echo empty($this->validation->auth_pass_error)?'':$this->validation->auth_pass_error; ?></td>
          </tr>
          <tr align="center" bgcolor="#F6F6F6" height="34" >
            <td height="20" colspan="2"><input type="button" name="Submit" value="<?=$formbutton?>" class="button-css" onClick="javascript:document.postform.submit();">
	    <input type="button" name="back" value="返 回" class="button-css" onClick="javascript:window.history.go(-1);">
	    </td>
          </tr>
        </table>
		<input type="hidden" name="ID" value="<?=$ID?>">
 	  </form><br>
        <br>
    </td>
  </tr>
</table>
</td></tr></table>
		</div>
		<table width="20" border="0" cellpadding="00">
          <tr>
            <td height="4"></td>
          </tr>
        </table>		
		</td>
      </tr>
    </table>
<br>
</body>
</html>